include_directories(
	.. # to include proto
	${SDL2_INCLUDE_DIRS})
add_definitions(-DSTATIC)
set(CDOGS_SOURCES
	actor_fire.c
	actor_pickup.c
	actor_placement.c
	actors.c
	aheasing/easing.c
	ai.c
	ai_context.c
	ai_coop.c
	ai_utils.c
	algorithms.c
	ammo.c
	animation.c
	AStar.c
	automap.c
	blit.c
	bullet_class.c
	c_array.c
	camera.c
	campaign_entry.c
	campaigns.c
	character.c
	character_class.c
	collision/collision.c
	collision/minkowski_hex.c
	color.c
	config.c
	config_apply.c
	config_io.c
	config_json.c
	config_old.c
	cpic.c
	damage.c
	defs.c
	door.c
	draw/char_sprites.c
	draw/draw.c
	draw/draw_actor.c
	draw/draw_buffer.c
	draw/drawtools.c
	draw/nine_slice.c
	emitter.c
	events.c
	files.c
	font.c
	font_utils.c
	game_events.c
	game_mode.c
	gamedata.c
	grafx.c
	grafx_bg.c
	handle_game_events.c
	hud/fps.c
	hud/gauge.c
	hud/health_gauge.c
	hud/hud.c
	hud/hud_num_popup.c
	hud/player_hud.c
	hud/wall_clock.c
	joystick.c
	json_utils.c
	keyboard.c
	log.c
	los.c
	map.c
	map_archive.c
	map_build.c
	map_cave.c
	map_classic.c
	map_interior.c
	map_new.c
	map_object.c
	map_static.c
	map_wolf.c
	material.c
	mathc/mathc.c
	mission.c
	mission_convert.c
	mission_static.c
	mouse.c
	music.c
	net_client.c
	net_server.c
	net_util.c
	objective.c
	objs.c
	palette.c
	particle.c
	path_cache.c
	pic.c
	pic_manager.c
	pickup.c
	pickup_class.c
	pics.c
	player.c
	player_template.c
	powerup.c
	quick_play.c
	screen_shake.c
	sounds.c
	texture.c
	thing.c
	tile.c
	tile_class.c
	triggers.c
	utils.c
	vector.c
	weapon.c
	weapon_class.c
	weapon_usage.c
	window_context.c
	XGetopt.c
	yajl_utils.c)
set(CDOGS_HEADERS
	actor_fire.h
	actor_pickup.h
	actor_placement.h
	actors.h
	aheasing/easing.h
	ai.h
	ai_context.h
	ai_coop.h
	ai_utils.h
	algorithms.h
	ammo.h
	animation.h
	AStar.h
	automap.h
	blit.h
	bullet_class.h
	c_array.h
	camera.h
	campaign_entry.h
	campaigns.h
	character.h
	character_class.h
	collision/collision.h
	collision/minkowski_hex.h
	color.h
	config.h
	config_io.h
	config_json.h
	config_old.h
	cpic.h
	damage.h
	defs.h
	door.h
	draw/char_sprites.h
	draw/draw.h
	draw/draw_actor.h
	draw/draw_buffer.h
	draw/drawtools.h
	draw/nine_slice.h
	emitter.h
	events.h
	files.h
	font.h
	font_utils.h
	game_events.h
	game_mode.h
	gamedata.h
	grafx.h
	grafx_bg.h
	handle_game_events.h
	hud/fps.h
	hud/gauge.h
	hud/health_gauge.h
	hud/hud.h
	hud/hud_defs.h
	hud/hud_num_popup.h
	hud/player_hud.h
	hud/wall_clock.h
	joystick.h
	json_utils.h
	keyboard.h
	log.h
	los.h
	map.h
	map_archive.h
	map_build.h
	map_cave.h
	map_classic.h
	map_interior.h
	map_new.h
	map_object.h
	map_static.h
	map_wolf.h
	material.h
	mathc/mathc.h
	mission.h
	mission_convert.h
	mission_static.h
	mouse.h
	music.h
	net_client.h
	net_server.h
	net_util.h
	objective.h
	objs.h
	palette.h
	particle.h
	path_cache.h
	pic.h
	pic_manager.h
	pickup.h
	pickup_class.h
	pics.h
	player.h
	player_template.h
	powerup.h
	quick_play.h
	screen_shake.h
	sounds.h
	sys_config.h
	sys_specifics.h
	texture.h
	thing.h
	tile.h
	tile_class.h
	triggers.h
	utils.h
	vector.h
	weapon.h
	weapon_class.h
	weapon_usage.h
	window_context.h
	XGetopt.h
	yajl_utils.h)

if(NOT USE_SHARED_ENET)
    add_subdirectory(enet)
endif()

add_subdirectory(c_hashmap)
add_subdirectory(cwolfmap)
add_subdirectory(SDL_JoystickButtonNames)
add_subdirectory(yajl)

add_library(cdogs STATIC
	${CDOGS_SOURCES} ${CDOGS_HEADERS})

target_link_libraries(cdogs
	c_hashmap
	cwolfmap
	json
	SDL_joystickbuttonnames
	yajl_s
	SDL2::SDL2
	SDL2_mixer::SDL2_mixer
	${ENet_LIBRARIES})
